spirv-std
Core functions, traits, and more that make up a “standard library” for SPIR-V for use in rust-gpu.
This crate gives a rust-gpu
shader access to the required #![spirv(..)]
attribute, as well as povide all kinds of APIs that allows a shader to access GPU resources such as textures and buffers. Optionally, through the use of the "glam"
feature, it includes some boilerplate trait implementations to make glam
vector types compatible with these APIs.
🚨 BREAKING 🚨
As of 0.4.0-alpha.16
, your shaders will require a different preamble. See this migration guide for more information.
Example
Here is a small excerpt to see what a shader would look like. See source for full details of the shader that generates above image.
use spirv;
use ;
Getting started
Check out The rust-gpu
Dev Guide for information on how to get started with using it in your projects.
Experiment with rust-gpu shaders in-browser at SHADERed.